import request from '@/utils/request'

// 查询订单还车列表
export function orderReturnList(query) {
  return request({
    url: '/returnCar/orderReturn/list',
    method: 'get',
    params: query
  })
}


// 导出订单还车列表
export function orderReturnExport(data) {
  return request({
    url: '/returnCar/orderReturn/export',
    method: 'post',
    data:data
  })
}

// 发起还车
export function orderReturn(data) {
    return request({
        url: '/returnCar/orderReturn',
        method: 'post',
        data:data
    })
}

// 发起还车详情
export function initiationDetails(orderNo) {
    return request({
        url: `/returnCar/orderReturn/initiationDetails/${orderNo}`,
        method: 'get'
    })
}

// 获取订单还车详细信息
export function orderReturnDetail(param) {
    return request({
        url: `/returnCar/orderReturn/getInfo`,
        method: 'get',
        params: param
    })
}

// 查询所属公司
export function deptList(query) {
    return request({
        url: '/system/dept/list',
        method: 'get',
        params: query
    })
}

// 计算扣款费用
export function calculateDeductionFees(data) {
    return request({
        url: '/returnCar/orderReturn/calculateDeductionFees',
        method: 'post',
        data:data
    })
}


// 获取还车预警配置
export function orderReturnWarningDetail() {
    return request({
        url: `/returnCar/orderReturnWarning`,
        method: 'get'
    })
}

// 修改还车预警配置
export function calculateDeductionFeesSave(data) {
    return request({
        url: '/returnCar/orderReturnWarning',
        method: 'put',
        data:data
    })
}

// 获取第三方检测城市
export function getCbsTestDeptList() {
    return request({
        url: `/returnCar/orderReturn/getCbsTestDeptList`,
        method: 'get'
    })
}
// 获取第三方检测单
export function queryReport(orderNo) {
    return request({
        url: `/returnCar/orderReturn/queryReport?orderNo=`+orderNo,
        method: 'get'
    })
}

// 获取车辆租金欠款金额
export function getObtainRentArrears(orderNo) {
    return request({
        url: `/returnCar/orderReturn/getObtainRentArrears/${orderNo}`,
        method: 'get'
    })
}
